<template>
  <el-container>
    <component :is="currentPage" :procno="procno" :row="row" @toChangePage="changePage" />
  </el-container>
</template>

<style scoped>
  .fade-enter-active, .fade-leave-active {
    transition: opacity 1s;
  }
  .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
    opacity: 0;
  }
</style>

<script>
import list from './module/index'
import add from './module/add'
import edit from './module/edit'
import node_info_set from './module/node_info_set'
export default {
  components: {
    list,
    add,
    edit,
    node_info_set
  },
  data: function() {
    return {
      procno: {},
      row: {},
      currentPage: 'list'
    }
  },
  created() {
    const obj = this.$route.params
    if (obj) {
      this.procno = obj.procno
    }
  },
  methods: {
    changePage(page, row) {
      this.row = row
      if (!page) {
        page = 'list'
      }
      this.currentPage = page
    }
  }
}
</script>
